<template>
  <el-breadcrumb separator-class="el-icon-arrow-right">
    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
    <el-breadcrumb-item
      ><router-link :to="url">{{
        $route.name
      }}</router-link></el-breadcrumb-item
    >
  </el-breadcrumb>
</template>
<script>
export default {
  data() {
    return {
      url: ""
    }
  },
  watch: {
    $route: function (to, from) {
      console.log(this.$route);
      this.url = to.path;
    }
  }
}
</script>